<template>
  <div class="index">
    <div class="banner">
      <img class="banner-image" src="../assets/active.jpg">
      <img class="top" src="../assets/banner-top.png">
      <img class="top logo1" src="../assets/banner-logo1.png">
      <img class="top logo2" style="opacity: 0;" src="../assets/banner-logo2.png">
      <div class="btn btn-left" @click="isShowExp = true"></div>
      <div class="btn btn-right" @click="linkGame"></div>
    </div>
    <div class="exp" v-if="isShowExp" @click="isShowExp = false">
      <div> 
        <img src="../assets/active-exp.png">
      </div>
    </div>
  </div>
</template>
<script>
import getQueryString from '../api/url'

export default {
  data () {
    return {
      isShowExp: false
    }
  },
  methods: {
    linkGame () {
      if (getQueryString('isAuth') && parseInt(getQueryString('isAuth')) === 1) {
        this.$router.replace('/game')
      } else {
        this.$router.replace('/choose')
      }
    }
  }
}
</script>
<style lang="scss" type="text/scss">
  img {
    pointer-events: none;
  }

  .index {
    .banner {
      .top {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
      }
      .banner-image {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
      }
      .btn {
        position: absolute;
        bottom: 4vh;
        width: 44%;
        height: 7%;
      }
      .btn-left {
        left: 4%;
      }
      .btn-right {
        right: 4%;
      }
      
    }

    .exp {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100vh;
      background: rgba(0, 0, 0, .6);
      z-index: 1000;
      > div {
        position: absolute;
        top: 50%;
        left: 0;
        -webkit-transform: translate3d(0, -50%, 0);
        transform: translate3d(0, -50%, 0);
      }
    }
  }
</style>
